package cn.pzhu.java.ch04.collectiondemo;

import java.util.LinkedList;
import java.util.List;

public class ListDemo {

	
	public static void main(String[] args) {
		Student s1=new Student(1, "zhang3");
		Student s2=new Student(2, "Li4");
		Student s3=new Student(3, "wang5");
	//	List<Student> list=new ArrayList<Student>();
		List<Student> list=new LinkedList<Student>();
		list.add(s1);
		list.add(s2);
		list.add(s3);
		list.add(s1);
		for(Student s:list){
			System.out.println(s);
		}
		list.remove(s1);
		list.remove(1);
		
		/*//order get by indexer
		Student s=list.get(0);
		System.out.println(s);*/
	}

}
